/**
 * Copyright (c) 2009 Cerner Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Cerner Corporation - initial API and implementation
 */
package com.cerner.system.rest.jaas.cas;

import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;

/**
 * A {@link LoginException} that propagates exceptions that identify
 * alternative, valid execution flows in CASified {@link LoginModule}s.
 * 
 * @author Alex Horn
 * @since 1.0.0
 */
public class CasLoginException extends LoginException {

  CasLoginException(String message) {
    super(message);
  }

  /**
   * Instantiations of this CAS-specific {@link LoginException} should only
   * happen within the scope of the {@link CasLoginModule}.
   * 
   * @param cause runtime or checked exception that causes disruptions in the
   *          {@link CasLoginModule}
   */
  CasLoginException(Exception cause) {
    super(cause.toString());
    initCause(cause);
  }

  private static final long serialVersionUID = 0;
}
